package com.hnkywl.sts.entity.cwgl.kmys;

import com.hnkywl.sts.entity.BaseEntity;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ccr
 * Date: 13-5-16
 * Time: 下午9:25
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_SYS_TYFZHSYS")
@Where(clause = "deleted!='1'")
public class Tyfzhsys extends BaseEntity{
    @Id
    @SequenceGenerator(name = "seqTyfzhsys", allocationSize = 1, sequenceName = "SEQ_SYS_TYFZHSYS")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqTyfzhsys")
    private Long id;

    //名称
    private String mc;

    //值
    private String code;

    //大类
    private String dl;

     //助记码
    private String zjm;

    //下级通用辅助核算映射
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TYFZHSYS_ID")
    @Where(clause = "deleted!='1'")
    private Tyfzhsys sjtyfzhsys;


    @OneToMany(mappedBy = "sjtyfzhsys", cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Tyfzhsys.class)
    @Where(clause = "deleted!='1'")
    private List<Tyfzhsys> tyfzhsysList;

    //上级通用辅助核算映射
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TYFZHSMC_ID")
    @Where(clause = "deleted!='1'")
    private Tyfzhsmc tyfzhsmc;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDl() {
        return dl;
    }

    public void setDl(String dl) {
        this.dl = dl;
    }

    public String getZjm() {
        return zjm;
    }

    public void setZjm(String zjm) {
        this.zjm = zjm;
    }

    public Tyfzhsys getSjtyfzhsys() {
        return sjtyfzhsys;
    }

    public void setSjtyfzhsys(Tyfzhsys sjtyfzhsys) {
        this.sjtyfzhsys = sjtyfzhsys;
    }

    public Tyfzhsmc getTyfzhsmc() {
        return tyfzhsmc;
    }

    public void setTyfzhsmc(Tyfzhsmc tyfzhsmc) {
        this.tyfzhsmc = tyfzhsmc;
    }

    public List<Tyfzhsys> getTyfzhsysList() {
        return tyfzhsysList;
    }

    public void setTyfzhsysList(List<Tyfzhsys> tyfzhsysList) {
        this.tyfzhsysList = tyfzhsysList;
    }
}
